//
//  UIButton+HWChain.m
//  HomeWork
//
//  Created by apple on 2017/10/26.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "UIButton+HWChain.h"

@implementation UIButton (HWChain)

- (UIButton *(^)(NSString *title))chainTitleForNormal{
    return ^(NSString *title){
        [self setTitle:title forState:UIControlStateNormal];
        return self;
    };
}

- (UIButton *(^)(UIColor *color))chainTitleColorForNormal{
    return ^(UIColor *color){
        [self setTitleColor:color forState:UIControlStateNormal];
        return self;
    };
}

- (UIButton *(^)(NSString *imageName))chainImageNameForNormal{
    return ^(NSString *imageName){
        [self setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
        return self;
    };
}

- (UIButton *(^)(NSString *imageName))chainBackgroundIamgeNameForNormal{
    return ^(NSString *imageName){
        [self setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
        return self;
    };
}

- (UIButton *(^)(UIFont *font))chainTitleForFont{
    return ^(UIFont *font){
        self.titleLabel.font = font;
        return self;
    };
}
@end
